<%@page import="com.tubeonfire.search.TubeSearchModel"%>
<%@page import="com.tubeonfire.entity.Tube"%>
<%@page import="com.tubeonfire.model.admin.SiteConfigModel"%>
<%@page import="com.tubeonfire.entity.SiteConfig"%>
<%@page contentType="text/xml; charset=UTF-8" language="java" %>
<%@page import="java.util.ArrayList"%>
<%
	TubeSearchModel model = (TubeSearchModel) request.getAttribute("model"); 
	SiteConfig siteConfig = SiteConfigModel.get();
%>
<?xml version="1.0" encoding="UTF-8"?>
  <rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">
	
    <channel>
    <title><![CDATA[<%=siteConfig.getSiteTitle()%>]]></title>
    <link><%=request.getServerName() %></link>
    <description><![CDATA[<%=siteConfig.getSiteDescription() %>]]></description>
    <dc:language>en-ca</dc:language>
    <dc:creator>google app engine</dc:creator>

    <dc:rights>Copyright 2012</dc:rights>
    <admin:generatorAgent rdf:resource="<%=request.getServerName() %>" />
    	<%
    	for(Tube tub: model.getListResult()){		
   		%>
	       <item>
	          <title><![CDATA[<%=tub.getTitle()%>]]></title>
	          <link>http://<%=request.getServerName() %>/video/<%=tub.getId() %>/<%=tub.getAlias() %>.html</link>	          
	          <comments>http://<%=request.getServerName() %>/video/<%=tub.getId() %>/<%=tub.getAlias() %>.html#comment</comments>	
	          <description><![CDATA[<%=tub.getDescription()%>]]></description>
	          <pubDate><%=tub.getUpdated()%></pubDate>
	       </item>
      	<%
   		}
       	%>
    </channel>
</rss>  